package com.edais.service;

import java.util.Map;

import org.springframework.stereotype.Service;

@Service
public interface KcodeService {

	/**
	 * 
	 * @Description: 检测K码发送资格（检测接口的校验）
	 * @param mobile
	 *            手机
	 * @param userId
	 *            用户id
	 * @param merchant
	 *            商户
	 * @return
	 * @throws Exception
	 * @return String code 检测结果码
	 * @author ruXinChao
	 * @date 2016-9-18 下午2:45:31
	 */
	public String checkKcode(String mobile, String userId, String merchant) throws Exception;
	
	
	/**
	 * 
	 * @Description:  短信发送借口的校验 主要是根据订单和商户校验 检测K码发送资格
	 * @param mobile
	 * @param userId
	 * @param merchant
	 * @param orderId
	 * @return
	 * @throws Exception  
	 * @return String  
	 * @author ruXinChao
	 * @date 2016-9-21  下午7:27:25
	 */
	public String sendCheckKcode(String mobile, String userId, String merchant,
			String orderId) throws Exception;

	/**
	 * 
	 * @Description:  发送K码 并更新状态
	 * @param merchant
	 * @param phone
	 * @param orderId
	 * @param cardNo
	 * @return
	 * @throws Exception  
	 * @return String  
	 * @author ruXinChao
	 * @date 2016-9-21  上午9:57:28
	 */
	public String sendKcode(String logInfo, String merchant,String phone,String orderId,String cardNo) throws Exception;
	
	/**
	 * 
	 * @Description: 短信发送失败重发接口
	 * @param merchant
	 * @param phone
	 * @param orderId
	 * @return
	 * @throws Exception  
	 * @return String  
	 * @author ruXinChao
	 * @date 2016-9-24  上午10:27:01
	 */
	public String resendMsg(String logInfo,String merchant,String phone,String orderId) throws Exception;

	/**
	 * 
	 * @Description: 查询K码发送信息
	 * @param merchant
	 * @param orderId
	 * @return
	 * @throws Exception
	 * @return Map<String,Object>
	 * @author ruXinChao
	 * @date 2016-9-18 下午4:24:10
	 */
	public Map<String, Object> queryResult(String merchant, String orderId)
			throws Exception;

	/**
	 * 
	 * @Description: 更新K码记录表，以及T_USER_ACTIVITY_KEYCODE_LIST,并获得cadeNo
	 * @param merchant
	 * @param userId
	 * @param phone
	 * @param orderId
	 * @param money
	 * @return
	 * @throws Exception  
	 * @return Map<String,Object>  
	 * @author ruXinChao
	 * @date 2016-9-21  上午9:58:01
	 */
	public Map<String,Object> updateStatus(String merchant,String userId,String phone,String orderId,String money)
			throws Exception;

	/**
	 * 
	 * @Description: 根据渠道id查询加密密钥
	 * @param id
	 * @return
	 * @throws Exception
	 * @return String
	 * @author ruXinChao
	 * @date 2016-9-20 下午2:57:28
	 */
	public String getSecretKey(Integer id) throws Exception;
	
	/**
	 * 根据手机号获得K码发生信息（内部使用）
	 * @param merchant
	 * @param phone
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> queryResultByPhone(String merchant, String phone)
			throws Exception ;

}
